﻿using zijian666.Converts.Abstractions;
using zijian666.Converts.Convertor;
using zijian666.Converts.Core;

namespace zijian666.Converts;
internal class ObjectMappingConvertor<T> : ObjectConvertor<T>
{
    public override uint Priority => base.Priority + 1;
    public override ConvertResult<T> Convert(IConvertContext context, object? input)
    {
        var result = base.Convert(context, input);
        if (result.Success)
        {
            ConvertsMapping.ApplyMap(input, result.Value);
        }
        return result;
    }
}
